package com.travel.photos;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.ArrayList;
import java.util.List;


/**
 * Created by meidou on 2016/10/618.
 */
public class FragmentAdapter extends FragmentPagerAdapter {
    List<Fragment> fragmentlist;
    List<String> totailist;
    public FragmentAdapter(FragmentManager fm, List<Fragment> fragmentlist,List<String>totailist ) {
        super(fm);
        this.fragmentlist=fragmentlist;
        this.totailist=totailist;
    }

    @Override
    public Fragment getItem(int position) {
            return fragmentlist.get(position);
    }

    @Override
    public int getCount() {
            return fragmentlist.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return totailist.get(position);
    }
}
